<?php

namespace App\Http\Requests\API;

use App\Models\WechatUser;
use InfyOm\Generator\Request\APIRequest;

class UpdateWechatUserAPIRequest extends APIRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'nickname' => 'required_without_all:phone,headimgurl,country,province,city',
            'phone' => 'required_without_all:nickname,headimgurl,country,province,city',
            'headimgurl' => 'required_without_all:nickname,phone,country,province,city',
            'country' => 'required_without_all:nickname,phone,headimgurl,province,city',
            'province' => 'required_without_all:nickname,phone,headimgurl,country,city',
            'city' => 'required_without_all:nickname,phone,headimgurl,country,province',
        ];
    }
}
